<?php

/* @var $this yii\web\View */

use yii\helpers\Html;
use yii\widgets\ActiveForm;
//use app\assets\SmartWizardAsset;
//SmartWizardAsset::register($this);
?>
<div class='container' style='margin-bottom:100px;'>
<?php $form = ActiveForm::begin();?>
<?php
  if(isset($tip)&&$tip===true){
    if($model->hasErrors()){
?>
      <div class="alert alert-danger" role="alert">
        <?php
            foreach($model->getErrors("") as $key=>$value){
              echo $value."<br>";
            }
        ?>
      </div>
<?php
    }else{
?>
      <div class="alert alert-success" role="alert">设置成功！</div>
<?php
    }
  }
?>
<?php
$dbchannel = $this->context->sysConfig->pay_channel;
$allchannels = explode(',',$dbchannel);
$channellist=[];
$channeltip=[];
$j=0;
$channelinfo=[
  '1'=>[
    'label'=>'网银支付',
    'hint'=>'充值1元---5万元，请选择网银支付'
  ],
  '2'=>[
    'label'=>'支付宝',
    'hint'=>'充值1元---1万元，请选择支付宝'
  ],
  '3'=>[
    'label'=>'微信支付',
    'hint'=>'充值1元---2000元，请选择微信支付'
  ]
];
for($i=0;$i<count($allchannels);$i++){
  if($allchannels[$i]==1){
    foreach($channelinfo as $key=>$val){
      if($key==($i+1)){
          $channellist[$key]=$val['label'];
          $channeltip[$key]=$val['hint'];
      }
    }
  }
}
//var_dump($channellist);
//exit;
$channeltiptext=implode('；',$channeltip);
echo $form->field($model, 'channel')->dropDownList($channellist,['style'=>'padding:2px 3px;'])
->hint('说明：'.$channeltiptext);
//$form->field($model, 'channel')->dropDownList(['1'=>'通道一（网银）','2'=>'通道二（支付宝）','通道三（微信支付）'])
//->hint('说明：充值1元---5万元，请选择通道一（网银）；充值1元---1万元，请选择通道二（支付宝）；充值1元---2000元，请选择通道三（微信支付）')
?>


<?php ActiveForm::end(); ?>
</div>
